import { reactive, ref } from "vue";
import Main from "../main";
import Toolbar from "../component/toolbar.vue";

export default (main:Main) => {
    const enabled = ref(true);
    //
    const isFold = ref(false)
    const module = reactive({menu:true,nodelist:true,zoom:true,scale:true,full:true,edge:true,layout:true,map:true,switch:true,search:true,import:true,export:true})
    const reset = (options:Partial<typeof module>) => {
        Object.assign(module,options)
    }
    //
    return {
        enabled,
        Toolbar,
        props:{
            menu:main.menu.enabled,
            nodelist:main.nodelist.enabled,
            drawer:main.drawer.enabled,
            minimap:main.minimap.enabled,
            contextmenu:main.contextmenu.enabled,
            mousepos:main.mousepos.enabled,
            module,
            enabled,
            isFold,
            main
        },
        reset,
    }
}